
/**
  ******************************************************************************
  * @file           : main.h
  * @brief          : Header for main.c file.
  *                   This file contains the common defines of the application.
  ******************************************************************************
  * @attention
  *
  * Copyright (c) [2019] [Fudan Microelectronics]
  * THIS SOFTWARE is licensed under the Mulan PSL v1.
  * can use this software according to the terms and conditions of the Mulan PSL v1.
  * You may obtain a copy of Mulan PSL v1 at:
  * http:
  * THIS SOFTWARE IS PROVIDED ON AN "AS IS" BASIS, WITHOUT WARRANTIES OF ANY KIND, EITHER EXPRESS OR
  * IMPLIED, INCLUDING BUT NOT LIMITED TO NON-INFRINGEMENT, MERCHANTABILITY OR FIT FOR A PARTICULAR
  * PURPOSE.
  * See the Mulan PSL v1 for more details.
  *
  ******************************************************************************
  */



#ifndef __MAIN_H
#define __MAIN_H

#ifdef __cplusplus
extern "C" {
#endif


#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "mf_config.h"


#if defined(USE_FULL_ASSERT)
#include "fm33_assert.h"
#endif 















typedef int32_t  	s32;
typedef int16_t 	s16;
typedef int8_t  	s8;
typedef signed char	int8;
typedef unsigned long  	u32;
typedef unsigned short 	u16;
typedef unsigned char  	u8;
typedef unsigned long long u64 ;
typedef char c8 ;

typedef enum 
{
  RESET = 0U, 
  SET = !RESET
} FlagStatus, ITStatus;

typedef enum 
{
  DISABLE = 0U, 
  ENABLE = !DISABLE
} FunState;


typedef enum
{
  FAIL = 0U,
  PASS = !FAIL
} ErrorStatus;


typedef enum 
{

	Fire_Hydrant_Mode   =1,  
	Water_Pressure_Mode =2,  
	Water_Level_Mode    =3,  
	Door_Sensor_Mode    =4,  
	Water_Dip_Mode   =5,  
	Device_Market    =6,  
	Device_Show      =7,  
	Air_6in1_sensor  =8,  
	
}eDeviceMode;



#define Nb_Mode    0  
#define Lora_Mode  1
#define LoRaWAN_Mode  2
#define LoRa_1freq_Mode  4


#define LoRa_1freq_ch0  0  
#define LoRa_1freq_ch1  1
#define LoRa_1freq_ch2  2
#define LoRa_1freq_ch3  3

#define KEY_DOWN 						1
#define KEY_UP 							0

#define	Uart_ReceBufLen		90
#define TRUE 1
#define FALSE 0

#define SUCCESS 0
#define ERROR 1

#define	ErrCode_Success		0
#define	ErrCode_Fail		1
#define	ErrCode_Busy		2
#define	ErrCode_ReceData	3

#define IMEI_Len 	15
extern	uint8_t BC26_IMEI[IMEI_Len+1];

#define	ICCID_Len	20
extern	uint8_t BC26_ICCID[ICCID_Len+1];


typedef struct 
{
    	uint16_t PM1_0;
			uint16_t PM2_5;
			uint16_t PM10;
			uint16_t VOC;
			uint16_t temperature;
			uint16_t humi;
			uint8_t	AlarmFlag;
			uint8_t	SignalStrength;
}
measure_value ;





















void Error_Handler(void);









void LED_blink(uint8_t time);





#ifdef __cplusplus
}
#endif

#endif 


